
-- Unregister MOBS
--
-- Animals and monsters can be disable in minetest settings but not npcs ...so :

local unregister_mob = function(name)

  if mobs.spawning_mobs[name] then
    mobs.spawning_mobs[name] = nil
  end
  if minetest.registered_entities[name] then
    minetest.registered_entities[name] = nil
  end
  if minetest.registered_abms[name] then
    minetest.registered_abms[name] = nil
  end
  if minetest.registered_lbms[name .. "_spawning"] then
    minetest.registered_lbms[name .. "_spawning"] = nil
  end
  if minetest.registered_items[name] then
    minetest.unregister_item(name)
  end
  if minetest.registered_aliases[name] then
    minetest.registered_aliases[name] = nil
  end
end


if minetest.settings:get_bool("mobs_npc.igor", false) == false then
  unregister_mob('mobs_npc:igor')
end

if minetest.settings:get_bool("mobs_npc.trader", false) == false then
  unregister_mob('mobs_npc:trader')
  if minetest.registered_items['mobs:trader_block'] then
    minetest.unregister_item('mobs:trader_block')
  end
end
